Dependency Injection with Static Analysis and Context-Aware Policy

نویسندگان

  • Michael D. Ekstrand
  • Michael Ludwig
چکیده

The dependency injection design pattern improves the configurability, testability, and maintainability of object-oriented applications by decoupling components from both the concrete implementations of their dependencies and the strategy employed to select those implementations. In recent years, a number of libraries have emerged that provide automated support for constructing and connecting dependency-injected objects. Our experience developing systems with these tools has led us to identify two shortcomings of existing dependency injection solutions: the mechanisms for specifying component implementations often make it difficult to write and configure systems of arbitrarily-composable components, and the toolkit implementations often provide limited capabilities for inspection and static analysis of the object graphs of dependency-injected systems. We present Grapht, an new dependency injection container for Java that addresses these issues by providing context-aware policy, allowing component implementation decisions to depend on where in the object graph a component is required, and using a design that allows for static analysis of configured object graphs. To achieve its objectives, Grapht is built on a mathematical representation of dependency injection and object graphs that facilitates static analysis and straightforward implementation, and forms a basis for further consideration of the capabilities of dependency injection. The mathematical representation includes context-aware policy that we show to be strictly more expressive than the qualified dependencies used in many current toolkits. We demonstrate the utility of our approach with a case study showing how Grapht has aided in the development of the LensKit recommender systems toolkit.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

A semantic-aware role-based access control model for pervasive computing environments

Access control in open and dynamic Pervasive Computing Environments (PCEs) is a very complex mechanism and encompasses various new requirements. In fact, in such environments, context information should be used in access control decision process; however, it is not applicable to gather all context information completely and accurately all the time. Thus, a suitable access control model for PCEs...

متن کامل

Context-aware Modeling for Spatio-temporal Data Transmitted from a Wireless Body Sensor Network

Context-aware systems must be interoperable and work across different platforms at any time and in any place. Context data collected from wireless body area networks (WBAN) may be heterogeneous and imperfect, which makes their design and implementation difficult. In this research, we introduce a model which takes the dynamic nature of a context-aware system into consideration. This model is con...

متن کامل

Static Analysis for Guarded Code

Guarded(predicated) execution, as a new hardware feature, has been introduced into today's high performance processors. Guarded execution can signiicantly improve the performance of programs with conditional branches, and meanwhile also poses new challenges for conventional program analysis techniques. In this paper, we propose a static semantics inference mechanism to capture the semantics inf...

متن کامل

Reducing the U.S dependency on oil and gas imports, implications for its policies in the international system

This paper aims to firstly explain the significance of the U.S oil independency and its consequences on the U.S foreign strategy in international politics. Secondly, the implications of this energy policy on the U.S foreign policy in the international system context is examined. The hypothesis to address these inquiries is postulated using neo-realism theory. Accordingly, following oil independ...

متن کامل

Neuron-level Selective Context Aggregation for Scene Segmentation

Contextual information provides important cues for disambiguating visually similar pixels in scene segmentation. In this paper, we introduce a neuron-level Selective Context Aggregation (SCA) module for scene segmentation, comprised of a contextual dependency predictor and a context aggregation operator. The dependency predictor is implicitly trained to infer contextual dependencies between dif...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • Journal of Object Technology

دوره 15  شماره 

صفحات  -

تاریخ انتشار 2016